#ifndef _MAIN_DLG_H_
#define _MAIN_DLG_H_

class CMainDlg : 
    public CDialogImpl<CMainDlg>,
    public CWinDataExchange<CMainDlg>,
    public CMessageFilter,
    public CIdleHandler
{
public:
    enum { IDD = IDD_MAINDLG };

    virtual BOOL PreTranslateMessage(MSG* pMsg);
    virtual BOOL OnIdle();

    BEGIN_DDX_MAP(CMainDlg)
    END_DDX_MAP()

    BEGIN_MSG_MAP_EX(CMainDlg)
        MSG_WM_INITDIALOG(OnInitDialog)
        MSG_WM_DESTROY(OnDestroy)
        COMMAND_ID_HANDLER_EX(IDOK, OnOK)
        COMMAND_ID_HANDLER_EX(IDCANCEL, OnCancel)
    END_MSG_MAP()

    CMainDlg();
    ~CMainDlg();

    BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam);
    void OnDestroy();
    void OnOK(UINT uNotifyCode, int nID, CWindow wndCtl);
    void OnCancel(UINT uNotifyCode, int nID, CWindow wndCtl);

    void CloseDialog(int nVal);
};

#endif // _MAIN_DLG_H_